/**
 * @Author 宁铂
 * @Date 2021/7/6 0:39
 * @Version 1.0
 */
public class TestStatic {
    /** 本类测试static静态方法和字段 */
    public static void main(String[] args) {

        StaticTest st1 = new StaticTest();
        StaticTest st2 = new StaticTest();

        System.out.println(StaticTest.i++);
        System.out.println(st1.i);
        System.out.println(st2.i);

        StaticTest sf = new StaticTest();
        sf.increment();
        StaticTest.increment();

    }

}

class StaticTest{
    static int i = 47;
    static void increment(){
        StaticTest.i++;
    }
}
